package com.trhui.mallbook.client;

import com.trhui.mallbook.domain.common.ApiRequest;
import com.trhui.mallbook.domain.common.BaseResponse;
import com.trhui.mallbook.domain.request.xib.XibSetSplitRelationshipRequest;
import com.trhui.mallbook.domain.response.xib.XibSetSplitRelationshipResponse;
import com.trhui.mallbook.enums.ChannelTypeEnum;
import com.trhui.mallbook.enums.ServerCodeEnum;

/**
 * @description: 分账配置
 * @author: xiaogc
 * @date: 2025/1/24 15:31
 */
public class SplitConfigClient extends AbstractClient {
    /**
     * 设置分账关系
     * @param request
     * @return
     */
    public static BaseResponse<XibSetSplitRelationshipResponse> xibSetSplitRelationship(XibSetSplitRelationshipRequest request) {
        ApiRequest reqApiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.SET_SPLIT_RELATIONSHIP)
                .channelType(ChannelTypeEnum.XIB)
                .build();
        return post(reqApiRequest, XibSetSplitRelationshipResponse.class);
    }
}
